
cmake_minimum_required(VERSION 3.5.1)

project(linux-net-view LANGUAGES CXX VERSION 0.0.1)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5 COMPONENTS Core Widgets Network)

# 头文件目录
include_directories()

# 资源文件路径
set(QRC_SOURCES "")

add_executable(${PROJECT_NAME} "main.cpp"
    ${QRC_SOURCES}
)

find_package(BaseBuild PATHS ${CMAKE_SOURCE_DIR})
# project(${BASE_NAME} LANGUAGES ${BASE_PROGRAMME} VERSION ${BASE_VERSION})
#
base_feature_init(FEATURES ./build-template)

target_include_directories(${PROJECT_NAME} PRIVATE
    ${FEATURES_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Network
    ${FEATURES_LIBRARIES}
)


# 设置安装路径的前缀(默认为"/usr/local")
set(CMAKE_INSTALL_PREFIX "/usr")

# 设置执行 make install 时哪个目标应该被 install 到哪个位置
# CMAKE_INSTALL_PREFIX + "bin" --> /usr/bin

install(FILES linux-net-view.desktop
    DESTINATION share/applications)
install(TARGETS ${PROJECT_NAME}
    DESTINATION share/youwant/linux-net-view)
install(FILES linux-net-view.jpg
    DESTINATION share/youwant/linux-net-view/icon)

find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)